<template>
    <div>
        <div>{{msg}}</div>
        <input type="text" v-model="val"/>
        <button @click="msg=val">改变提示语句</button>
    </div>
</template>
<script>
export default{
    data(){
        return{
            msg:'今天真是美好的一天!',
            val:""
        }
    },
    watch:{
        msg(news,old){
           console.log(news,old)
        },
        val(news,old){
           console.log(news,old)
        }
    }
}
</script>